﻿@model HitMapsNew.Models.EditDataModel
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/EditData/_EditLayout.cshtml";
}
<span ng-controller="EditMenusController">

    בחר תפריט:
    <div data-angular-treeview="true"
         data-tree-id="menuTree"
         data-tree-model="menuItems"
         data-node-id="ID"
         data-node-label="Name"
         data-node-children="Children">
    </div>


    חפש כתובת:
    <mapaddress data-map-address-id="address" data-lat="32.016106" data-lng="34.773102" placeholder="הכנס כתובת" ></mapaddress>

    <map zoom="16" center="[{{address.location.lat}},{{address.location.lng}}]">
        <marker ng-repeat="lct in menuTree.currentNode.Locations" position="{{lct.LatLng}}" class="ng-scope"></marker>
        <info-window position="[{{address.location.lat}},{{address.location.lng}}]" visible="true">
            <span>המיקום הנבחר</span>
        </info-window>
    </map>


        <div id="addLocation">
            @using (Html.BeginForm("AddLocation", "EditData", FormMethod.Post, new { @class = "form-horizontal", role = "form",  enctype = "multipart/form-data" }))
            {
                <text>כותרת:</text>
                @Html.TextBoxFor(m => m.Title)

                <text>תוכן:</text>
                @Html.TextBoxFor(m => m.Content)
                
                <text>תמונה:</text>
                <input type="file" name="file" />

                <text>קישור:</text>
                @Html.TextBoxFor(m => m.Url)

                <input type="hidden" name="MenuID" value="{{menuTree.currentNode.ID}}" />
                <input type="hidden" name="Lat" value="{{address.location.lat}}" />
                <input type="hidden" name="Lng" value="{{address.location.lng}}" />
                <button id="addSubMenu" type="submit">הוסף</button>
            }
        </div>

        @section Scripts {
            <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
        }

</span>

